﻿using System;

namespace OdsServer.Common.Utils
{
    public static class ConverterUtils
    {
        public unsafe static string ByteArrayToUtf8String(sbyte* array, int length)
        {
            byte[] managedArr = new byte[length];

            for (int i = 0; i < managedArr.Length; i++)
            {
                managedArr[i] = (byte)*(array + i);
            }
            return new System.Text.UTF8Encoding().GetString(managedArr);
        }
    }
}